<template>
	<view>
		<custom-nav-bar title="修改信息" :navHeight="statusHeight" />
		<view class="nullBox"></view>
		<view class="selBox">
			<view class="rowItem">
				<view class="titleTxt">选择类型：</view>
				<uni-data-select class="rightInput" v-model="value" :localdata="range""></uni-data-select>
			</view>
			<view class="rowItem">
				<view class="titleTxt">施工单位：</view>
				<uni-data-select class="rightInput" v-model="value" :localdata="range""></uni-data-select>
			</view>
			<view class="rowItem">
				<view class="titleTxt">地市名称：</view>
				<uni-data-select class="rightInput" v-model="value" :localdata="range""></uni-data-select>
			</view>
			<view class="rowItem">
				<view class="titleTxt">项目部门：</view>
				<uni-data-select class="rightInput" v-model="value" :localdata="range""></uni-data-select>
			</view>
			<u-button @click="toDetail()" class="btnStyle" type="primary">确认修改</u-button>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			value: undefined,
			statusHeight:0,
			range: [
				{ value: 0, text: '施工' },
				{ value: 1, text: '监理' },
			]
		};
	},
	onReady() {
		this.statusHeight = uni.getStorageSync('systemHeight');
	},
	methods: {
		submit() {
			this.$refs.uForm
				.validate()
				.then((res) => {
					uni.$u.toast('校验通过');
				})
				.catch((errors) => {
					uni.$u.toast('校验失败');
				});
		},
		typeSelect(e) {
			console.log('typeSelect: ', e);
			this.model1.userInfo.type = e.name;
			this.$refs.uForm.validateField('userInfo.sex');
		},
		handleChooseCompany(e) {
			let { id, label } = e.value[0];
			this.model1.userInfo.company = label;
			this.showCompanyPicker = false;
		},
		handleChooseCity(e) {
			let { id, label } = e.value[0];
			this.model1.userInfo.city = label;
			this.showCityPicker = false;
		}
	}
};
</script>

<style lang="scss" scoped>
.nullBox {
	height: 30rpx;
}
.selBox {
	width: 690rpx;
	// height: 450rpx;
	border-radius: 20rpx;
	margin: 0 auto;
	background: #fff;
	box-sizing: border-box;
	padding: 26rpx;
	margin-bottom: 20rpx;

	.rowItem {
		width: 100%;
		height: 70rpx;
		line-height: 70rpx;
		margin-bottom: 20rpx;
		// background-color: pink;
		display: flex;
		font-size: 28rpx;

		::v-deep .uni-select {
			border-radius: 12rpx !important;
		}
	}
}
.btnStyle{
	border-radius: 12rpx;
	width: 690rpx;
	border-radius: 20rpx;
	position: fixed;
	bottom: calc(var(--window-bottom) + 80rpx);
	left: 0;
	right: 0;
	border: none;
}

</style>
